package sagroup.dracots.policy;

import sagroup.dracots.DracoReaction;
import sagroup.dracots.PolicySwitcher;

public class PolicyReaction extends DracoReaction {
	public PolicyReaction(byte mode, PolicySwitcher switcher) {
		super(mode, RPTuple.RP_TEMPLATE,
				new PolicyReactionListener(switcher));
	}

	@Override
	public String toString() {
		String msg = "[PolicyReaction] mode=";
		switch (super.getMode()) {
		case ONCE:
			msg = msg + "ONCE";
			break;
		case ONCEPERTUPLE:
			msg = msg + "ONCEPERTUPLE";
			break;
		}
		return msg + " template=" + super.getTemplate() + " listener="
				+ super.getListener().getClass().getName();
	}
}
